﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using Supermarket;
using AForge_zxing;

namespace XLSupermarket.Storehouse.Commodity_Delivery
{
    public partial class Commodity_Delivery_Table : Form
    {
        public Commodity_Delivery_Table()
        {
            InitializeComponent();
        }
        /// <summary>
        /// 查询功能
        /// </summary>
        private void Select() {
            string sql = "select * from Delivery_goods DG,Goods_Warehousing GW,Merchandise_inventory MI where DG.Stock_Number=MI.Stock_Number and GW.Bar_code=MI.Bar_code and MI.Bar_code like '%"+textBox1.Text+"%'";
            dataGridView1.AutoGenerateColumns = false;
            dataGridView1.DataSource = DBHelper.FillData(sql);
        }
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void Commodity_Delivery_Table_Load(object sender, EventArgs e)
        {
            Select();
        }
        /// <summary>
        /// 查询
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button1_Click(object sender, EventArgs e)
        {
            Select();
        }
        /// <summary>
        /// 扫码
        /// </summary>
        /// <param name="sender"></param>
        /// <param name="e"></param>
        private void button6_Click(object sender, EventArgs e)
        {
            Form1 AF = new Form1();
            DialogResult result = AF.ShowDialog();
            if (result == DialogResult.OK)
            {
                this.textBox1.Text = AF.reisbn;
            }
        }
    }
}
